package com.examples.httpserver;

import com.alibaba.fastjson.JSONObject;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class HttpServerStreamFlink {
    /***
     *  实时监控http服务
     * **/
    public static void main(String[] args) throws Exception {
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStream<JSONObject> dataStream = env.addSource(new Flink2HttpServerReader(8000, "/api/public/v1/flink/data/submit"));
        dataStream.addSink(new MyHttpServerTestSink()).setParallelism(10);
        env.execute();
    }
}
